package com.example.teaching_server.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * 用户打卡请求数据传输对象
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Schema(description = "用户打卡请求")
public class UserCheckinRequest {

    @Schema(description = "用户ID", example = "1")
    private Long userId;

    @Schema(description = "文字说明", example = "今天完成了数学作业打卡")
    private String description;

    @Schema(description = "打卡图片URL列表")
    private List<String> imageUrls;

    /**
     * 验证请求是否有效
     */
    public boolean isValid() {
        return userId != null && userId > 0;
    }

    /**
     * 是否有图片
     */
    public boolean hasImages() {
        return imageUrls != null && !imageUrls.isEmpty();
    }
}
